package com.maysham.tripod.common;

import lombok.Data;

@Data
public class Response<T> {
    private boolean success;
    private String error;
    private T data;

    public static <T> Response<T> ok(T data){
        Response<T> res = new Response<T>();
        res.setSuccess(true);
        res.setData(data);
        return res;
    }

    public static Response<String> fail(String error){
        Response<String> res = new Response<String>();
        res.setError(error);
        return res;
    }
}
